package org.geektimes.projects.user.web.listener;

import org.geekbang.projects.config.ConfigContext;
import org.geektimes.projects.user.support.ApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * 测试用途
 */
@Deprecated
public class TestingListener implements ServletContextListener {

    private Logger logger = Logger.getLogger(this.getClass().getName());

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        testConfig();

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    }



    public void testConfig(){
        logger.log(Level.INFO ,"测试配置值:" + ConfigContext.INSTANCE.getValue("testValue" , Integer.class));
        logger.log(Level.INFO ,"测试配置值:" + ConfigContext.INSTANCE.getValue("application.name" , String.class));
    }

}
